package kr.co.dongpang.android;

import android.content.Context;
import android.content.Intent;

public final class GCMCommonUtilities {
	
	// give your server registration url hereys
    static final String SERVER_URL = "http://www.dongpang.co.kr/android/dongpang.v01/gcm_server/register.php"; 

    // Google project id
    static final String SENDER_ID = "375964933120"; 

    /**
     * Tag used on log messages.
     */
    static final String TAG = "AndroidHive GCM";

    static final String DISPLAY_MESSAGE_ACTION =
            "com.androidhive.pushnotifications.DISPLAY_MESSAGE";

    static final String EXTRA_SENDER = "sender";
    static final String EXTRA_ID = "id";
    static final String EXTRA_NAME = "name";
    static final String EXTRA_MESSAGE = "message";
    static final String EXTRA_GOODCD = "goodcd";
    static final String EXTRA_GOODNM = "goodnm";

    /**
     * Notifies UI to display a message. 
     * <p>
     * This method is defined in the common helper because it's used both by
     * the UI and the background service.
     *
     * @param context application's context.
     * @param message message to be displayed.
     */
    static void displayMessage(Context context,String sender, String id, String name, String message, String goodcd, String goodnm) {
        Intent intent = new Intent(DISPLAY_MESSAGE_ACTION);
        intent.putExtra(EXTRA_SENDER, sender);
        intent.putExtra(EXTRA_ID, id);
        intent.putExtra(EXTRA_NAME, name);
        intent.putExtra(EXTRA_MESSAGE, message);
        intent.putExtra(EXTRA_GOODCD, goodcd);
        intent.putExtra(EXTRA_GOODNM, goodnm);
        context.sendBroadcast(intent);
    }
}
